<!--
*@Author: QWP
*@Description: 创建新闻
*@Date: 2024-07-08 17:04:38
-->
<template>
  <u-dialog v-bind="$attrs"
    @close="dialogClose">
    <a-layout class="f-h-100">
      <a-layout-content class="s-bg-white"
        style="overflow: auto">
        <a-space  direction="vertical" class="f-w-100">
          <u-busi-card title=""
            :bordered="false">
            <u-form :elements="formEls"
              :model="form"
              :gutter="0"
              ref="formRef">
            </u-form>
          </u-busi-card>
          <div style="height: 500px">
            <u-wang-editor />
          </div>
          <u-card title="封面">
            <u-upload-img></u-upload-img>
          </u-card>
        </a-space>
      </a-layout-content>
    </a-layout>
  </u-dialog>
</template>

<script lang='ts' setup>
import { ref, reactive, computed, onMounted, h } from 'vue' 

import { useRoute, useRouter } from 'vue-router'
import { _IFormEl, _IExtra } from '@/src/components/common/form/interface';
import { FormInstance, FormItemProps } from 'ant-design-vue';
import { HomeOutlined, FileTextOutlined, UploadOutlined } from '@ant-design/icons-vue';
import { TreeProps } from 'ant-design-vue/es/vc-tree';
import { ColumnProps } from 'ant-design-vue/es/table';
import { _IColumnProps } from '@/components/common/tableEdit/interface.ts'
import { fileCols } from '@/common/model/fileCols'
import { depts } from '@/common/model/base'
const route = useRoute()

const formRef = ref<FormInstance>()
const form = reactive({
  zcflmc: '丁艳玲'
})
const formItemProps: FormItemProps & _IExtra = {
  labelWidth: '90px',
  colon: false
}
const formEls: Array<_IFormEl> = [
  { label: '主题', key: 'title', col: { span: 12,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } 
  },
  { label: '新闻来源', key: 'swbm', col: { span: 12 }, element: 'select', 
    formItemProps: { ...formItemProps, required: true },
    componentProps: {  
      options: [
        {label: '官方渠道', value: '1'},
        {label: '媒体机构', value: '2'},
        {label: '个人或组织提供的线索', value: '3'},
        {label: '公共档案和资料', value: '4'},
        {label: '社交媒体和自媒体', value: '5'},
        {label: '实地调查', value: '6'},
      ]
    } 
  },
  { label: '发布人', key: 'zcflmc', col: { span: 12 }, element: 'input', 
    formItemProps: { ...formItemProps, },
    componentProps: { disabled: true } 
  },
  { label: '发布单位', key: 'zcmc', col: { span: 12 }, element: 'select', 
    formItemProps: { ...formItemProps, required: true },
    componentProps: { options: depts }
  },
  { label: '备注', key: 'sm', col: { span: 24 }, element: 'textarea', 
    formItemProps: { ...formItemProps, } 
  },
]

// 文件上传列表
const tabData: Array<any> = reactive([]); 
const columns: Array<_IColumnProps> = fileCols(); 

// 付款约定
const detialTabData: Array<any> = reactive([]); 
const detialCols: Array<_IColumnProps> = [
  { title: '付款批次', dataIndex: 'zcmc', minWidth: 150, element: 'input' },
  { title: '付款比例 ', dataIndex: 'lyr', minWidth: 150, element: 'number' },
  { title: '付款金额', dataIndex: 'fkje', minWidth: 150, element: 'money' },
  { title: '备注', dataIndex: 'bz', minWidth: 150, element: 'input' },
]; 


// 弹窗关闭
const dialogClose = () => {
  formRef.value.form.resetFields();
}
</script>

<style lang='scss' >
</style>